<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition
	template="/administration/general/templates/template.xhtml">
	<ui:define name="menu">
		<ui:include src="/administration/general/templates/monitorMenu.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form id="realFiles">
			<h:messages style="color:red;"></h:messages>
			<div><b>Monitoreo de eventos- Carga de Archivos-Tiempo Real</b><br></br></div>
			<h:dataTable value="#{fileLoadBean.realTime}" var="transactions"
				styleClass="order-table" headerClass="order-table-header"
				rowClasses="order-table-odd-row,order-table-even-row">
				<h:column>
					<f:facet name="header">Id Archivo</f:facet>
					#{transactions.fileId}
				</h:column>
				<h:column>
					<f:facet name="header">Almacén</f:facet>
					#{transactions.brand}
				</h:column>
				<h:column>
					<f:facet name="header">Sucursal</f:facet>
					#{transactions.establishment}
				</h:column>
				<h:column>
					<f:facet name="header">Descripción</f:facet>
					#{transactions.description}
				</h:column>
				<h:column>
					<f:facet name="header">Fecha y Hora</f:facet>
					#{transactions.date}
				</h:column>
			</h:dataTable>
			<h:commandButton action="#{fileLoadBean.refresh}" value="refresh" id="refresh" style="display:none;" ></h:commandButton>
		</h:form>
		<script>
			setInterval(function() {
				var id = "realFiles:refresh";
				var button = $('#' + id.replace(':', '\\:'));
				button.trigger('click');
			}, 1000);
		</script>
	</ui:define>
</ui:composition>
</html>